package com.fanqiechaodan.factory.method;

import com.fanqiechaodan.factory.method.factory.Factory;
import com.fanqiechaodan.factory.method.factory.FactoryA;
import com.fanqiechaodan.factory.method.factory.FactoryB;
import com.fanqiechaodan.factory.method.product.Product;

/**
 * @author fanqiechaodan
 * @Classname Demo
 * @Description 工厂方法模式
 */
public class Demo {

    public static void main(String[] args) {
        Factory factory = new FactoryA();
        Product product = factory.createProduct();
        product.use();

        factory = new FactoryB();
        product = factory.createProduct();
        product.use();
    }
}
